import request from '@/config/axios'

export interface DrawingOrderTaskVO {
  id: number
  proportionNum: number
  explainText: string
  designer: string
  dictDrawingType: number
  planStartDate: localdate
  planEndDate: localdate
  dictIsDrawing: number
  workTaskId: number
  scheduleProportion: number
  productType: string
  dictJobOrderStatus: number
  designerJobNum: string
}

// 查询技术管理-图纸制作-制图派单任务单列表
export const getDrawingOrderTaskPage = async (params) => {
  return await request.get({ url: `/technology/drawing-order-task/page`, params })
}

// 查询技术管理-图纸制作-制图派单任务单详情
export const getDrawingOrderTask = async (id: number) => {
  return await request.get({ url: `/technology/drawing-order-task/getDetail?id=` + id })
}

// 新增技术管理-图纸制作-制图派单任务单
export const createDrawingOrderTask = async (data: DrawingOrderTaskVO) => {
  return await request.post({ url: `/technology/drawing-order-task/create`, data })
}

// 修改技术管理-图纸制作-制图派单任务单
export const updateDrawingOrderTask = async (data: DrawingOrderTaskVO) => {
  return await request.put({ url: `/technology/drawing-order-task/update`, data })
}

// 删除技术管理-图纸制作-制图派单任务单
export const deleteDrawingOrderTask = async (id: number) => {
  return await request.delete({ url: `/technology/drawing-order-task/delete?id=` + id })
}

// 导出技术管理-图纸制作-制图派单任务单 Excel
export const exportDrawingOrderTask = async (data) => {
  return await request.download({ url: `/technology/drawing-order-task/export-excel`, data })
}

//根据产品类型（部件档案）id查询部件名称
export const getProductDetailList = async (id) => {
  return await request.get({ url: `/config/drawing-component/get/component?id=` + id })
}